package com.dingding.gmall.product.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @author liugongding
 * @description:
 * @date 2022/3/14 9:12 PM
 */

@Configuration
public class SeataConfig {

    @Autowired
    DataSourceProperties dataSourceProperties;


    //@Bean
    //public MybatisSqlSessionFactoryBean sqlSessionFactoryBean(DataSource dataSource) throws IOException {
    //    // 这里用 MybatisSqlSessionFactoryBean 代替了 SqlSessionFactoryBean，否则 MyBatisPlus 不会生效
    //    MybatisSqlSessionFactoryBean mybatisSqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
    //    mybatisSqlSessionFactoryBean.setDataSource(dataSource);
    //    mybatisSqlSessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
    //            .getResources("classpath:/mapper/**/*.xml"));
    //    return mybatisSqlSessionFactoryBean;
    //}
}
